package com.quantdo.qtm.mysql.dao;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import com.quantdo.qtm.mysql.pojo.model.MysqlStatusCurrDo;

@Mapper
public interface MysqlStatusCurrDao {
    
    @Select("select * from mysql_status_curr")
    public MysqlStatusCurrDo select();

    @Delete("delete from mysql_status_curr")
    public int delete(MysqlStatusCurrDo statusCurrDo);

    @Insert("insert into mysql_status_curr(curr_time,interval_second,questions,com_commit,com_rollback,com_select,com_insert,com_update,com_delete"
            + ",threads_connected,threads_running,slow_queries,bytes_sent,bytes_received"
            + ",innodb_buffer_pool_pages_total,innodb_buffer_pool_pages_free,key_blocks_used,key_blocks_unused) "
            + "values(#{currTime},#{intervalSecond},#{questions},#{comCommit},#{comRollback},#{comSelect},#{comInsert},#{comUpdate},#{comDelete}"
            + ",#{threadsConnected},#{threadsRunning},#{slowQueries},#{bytesSent},#{bytesReceived}"
            + ",#{innodbBufferPoolPagesTotal},#{innodbBufferPoolPagesFree},#{keyBlocksUsed},#{keyBlocksUnused}) ")
    public int insert(MysqlStatusCurrDo statusCurrDo);

}


